package org.example.intern.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.intern.entity.common.SysResume;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface SysResumeMapper extends BaseMapper<SysResume> {

    @Select("SELECT * FROM resume limit #{pageNum},#{pageSize}")
    List<SysResume> selectByPage(Integer pageNum, Integer pageSize);

    @Select("select count(*) from resume")
    Integer selectTotal();

    @Insert("INSERT INTO roster (id, name, sex, phone, email, school, education, postion, addr) " +
            "VALUES (#{id}, #{name}, #{sex}, #{phone}, #{email}, #{school}, #{education}, #{postion}, #{addr})")
    Integer passResume(SysResume sysResume);

    @Insert("INSERT INTO talent_pool (id, name, sex, phone, email, school, education, postion, addr) " +
            "VALUES (#{id}, #{name}, #{sex}, #{phone}, #{email}, #{school}, #{education}, #{postion}, #{addr})")
    Integer backUpResume(SysResume sysResume);
}
